Dynomotion

Group: DynoMotion Message: 527 From: lrapso Date: 7/27/2010
Subject: error message
Hello I an new in the group.

I am setting up a set of 3 stepper motors to work with Kflop and Mch3,.

So I have repeated the following error:

ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=100;
ch0->Accel=1000;
ch0->Jerk=10000;
ch0->P=1;
ch0->I=0;
ch0->D=0;


C:\KMotion421\C Programs\FanON.c:7: incompatible types for redefinition of 'ch0'

I can't find wht is wrong, this lkines are similar with the example in the Kflop manual...

Somebody can help me
Group: DynoMotion Message: 528 From: pedro558587 Date: 7/27/2010
Subject: Re: error message
Hi,

As you did not post all the C program it is difficult to tell what is missing but it seems you did not included codes in a routine. Try following example:

#include "KMotionDef.h"

int main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=100;
ch0->Accel=1000;
ch0->Jerk=10000;
ch0->P=1;
ch0->I=0;
ch0->D=0;
}

and see if it give same errors. Meanwhile I don't know if the entered values are correct, it was just an example



--- In DynoMotion@yahoogroups.com, "lrapso" <lrapso@...> wrote:
>
> Hello I an new in the group.
>
> I am setting up a set of 3 stepper motors to work with Kflop and Mch3,.
>
> So I have repeated the following error:
>
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=100;
> ch0->Accel=1000;
> ch0->Jerk=10000;
> ch0->P=1;
> ch0->I=0;
> ch0->D=0;
>
>
> C:\KMotion421\C Programs\FanON.c:7: incompatible types for redefinition of 'ch0'
>
> I can't find wht is wrong, this lkines are similar with the example in the Kflop manual...
>
> Somebody can help me
>
Group: DynoMotion Message: 529 From: pedro558587 Date: 7/27/2010
Subject: Re: error message
reading your post is difficult to understand well, it could be better have tha complete C program. Anyway it seems you did non include the portions of commands in a routine....try to use following


#include "KMotionDef.h"

int main()
{
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=100;
ch0->Accel=1000;
ch0->Jerk=10000;
ch0->P=1;
ch0->I=0;
ch0->D=0;
}

I am not sure about values but only of the syntax of commands




--- In DynoMotion@yahoogroups.com, "lrapso" <lrapso@...> wrote:
>
> Hello I an new in the group.
>
> I am setting up a set of 3 stepper motors to work with Kflop and Mch3,.
>
> So I have repeated the following error:
>
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=100;
> ch0->Accel=1000;
> ch0->Jerk=10000;
> ch0->P=1;
> ch0->I=0;
> ch0->D=0;
>
>
> C:\KMotion421\C Programs\FanON.c:7: incompatible types for redefinition of 'ch0'
>
> I can't find wht is wrong, this lkines are similar with the example in the Kflop manual...
>
> Somebody can help me
>
Group: DynoMotion Message: 531 From: lrapso Date: 7/27/2010
Subject: Re: error message
Hello

Thanks a lot
Now i undurtand what is my error, it is because my lack of knowledge in C Syntax, in the use of the brakets {}

#include "KMotionDef.h"

main()
{

}
ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=100;
ch0->Accel=1000;
ch0->Jerk=10000;
ch0->P=1;
ch0->I=0;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=200;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=0;
ch0->InputChan1=1;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=250;

ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=1;
ch0->iir[2].B1=0;
ch0->iir[2].B2=0;
ch0->iir[2].A1=0;
ch0->iir[2].A2=0;


--- In DynoMotion@yahoogroups.com, "pedro558587" <el_gato_pedro@...> wrote:
>
>
>
>
> reading your post is difficult to understand well, it could be better have tha complete C program. Anyway it seems you did non include the portions of commands in a routine....try to use following
>
>
> #include "KMotionDef.h"
>
> int main()
> {
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=100;
> ch0->Accel=1000;
> ch0->Jerk=10000;
> ch0->P=1;
> ch0->I=0;
> ch0->D=0;
> }
>
> I am not sure about values but only of the syntax of commands
>
>
>
>
> --- In DynoMotion@yahoogroups.com, "lrapso" <lrapso@> wrote:
> >
> > Hello I an new in the group.
> >
> > I am setting up a set of 3 stepper motors to work with Kflop and Mch3,.
> >
> > So I have repeated the following error:
> >
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=100;
> > ch0->Accel=1000;
> > ch0->Jerk=10000;
> > ch0->P=1;
> > ch0->I=0;
> > ch0->D=0;
> >
> >
> > C:\KMotion421\C Programs\FanON.c:7: incompatible types for redefinition of 'ch0'
> >
> > I can't find wht is wrong, this lkines are similar with the example in the Kflop manual...
> >
> > Somebody can help me
> >
>
Group: DynoMotion Message: 533 From: Tom Kerekes Date: 7/27/2010
Subject: Re: error message
Hi lrapso,

Yes C main function consists of the block of code between the open and close curly brackets.

Although not necessary, most C programmers indent the code between the brackets by one tab so that it is easier to read and see the code is associated with the main function.  This is especially helpful when blocks of code are nested.

Regards
TK

Group: DynoMotion Message: 535 From: pedro558587 Date: 7/27/2010
Subject: Re: error message
sorry but still wrong brackets- To assign values to variables instances shoud be inside function brackets otherwwise it is understand as declarations and you receive same error. Modify like:


#include "KMotionDef.h"

main()
{

ch0->InputMode=NO_INPUT_MODE;
ch0->OutputMode=STEP_DIR_MODE;
ch0->Vel=100;
ch0->Accel=1000;
ch0->Jerk=10000;
ch0->P=1;
ch0->I=0;
ch0->D=0;
ch0->FFAccel=0;
ch0->FFVel=0;
ch0->MaxI=200;
ch0->MaxErr=200;
ch0->MaxOutput=200;
ch0->DeadBandGain=1;
ch0->DeadBandRange=0;
ch0->InputChan0=0;
ch0->InputChan1=1;
ch0->OutputChan0=0;
ch0->OutputChan1=1;
ch0->MasterAxis=-1;
ch0->LimitSwitchOptions=0x0;
ch0->InputGain0=1;
ch0->InputGain1=1;
ch0->InputOffset0=0;
ch0->InputOffset1=0;
ch0->OutputGain=1;
ch0->OutputOffset=0;
ch0->SlaveGain=1;
ch0->invDistPerCycle=1;
ch0->Lead=0;
ch0->MaxFollowingError=1000000000;
ch0->StepperAmplitude=250;
ch0->iir[0].B0=1;
ch0->iir[0].B1=0;
ch0->iir[0].B2=0;
ch0->iir[0].A1=0;
ch0->iir[0].A2=0;

ch0->iir[1].B0=1;
ch0->iir[1].B1=0;
ch0->iir[1].B2=0;
ch0->iir[1].A1=0;
ch0->iir[1].A2=0;

ch0->iir[2].B0=1;
ch0->iir[2].B1=0;
ch0->iir[2].B2=0;
ch0->iir[2].A1=0;
ch0->iir[2].A2=0;

}


and it is correct :-)

--- In DynoMotion@yahoogroups.com, "lrapso" <lrapso@...> wrote:
>
> Hello
>
> Thanks a lot
> Now i undurtand what is my error, it is because my lack of knowledge in C Syntax, in the use of the brakets {}
>
> #include "KMotionDef.h"
>
> main()
> {
>
> }
> ch0->InputMode=NO_INPUT_MODE;
> ch0->OutputMode=STEP_DIR_MODE;
> ch0->Vel=100;
> ch0->Accel=1000;
> ch0->Jerk=10000;
> ch0->P=1;
> ch0->I=0;
> ch0->D=0;
> ch0->FFAccel=0;
> ch0->FFVel=0;
> ch0->MaxI=200;
> ch0->MaxErr=200;
> ch0->MaxOutput=200;
> ch0->DeadBandGain=1;
> ch0->DeadBandRange=0;
> ch0->InputChan0=0;
> ch0->InputChan1=1;
> ch0->OutputChan0=0;
> ch0->OutputChan1=1;
> ch0->MasterAxis=-1;
> ch0->LimitSwitchOptions=0x0;
> ch0->InputGain0=1;
> ch0->InputGain1=1;
> ch0->InputOffset0=0;
> ch0->InputOffset1=0;
> ch0->OutputGain=1;
> ch0->OutputOffset=0;
> ch0->SlaveGain=1;
> ch0->invDistPerCycle=1;
> ch0->Lead=0;
> ch0->MaxFollowingError=1000000000;
> ch0->StepperAmplitude=250;
>
> ch0->iir[0].B0=1;
> ch0->iir[0].B1=0;
> ch0->iir[0].B2=0;
> ch0->iir[0].A1=0;
> ch0->iir[0].A2=0;
>
> ch0->iir[1].B0=1;
> ch0->iir[1].B1=0;
> ch0->iir[1].B2=0;
> ch0->iir[1].A1=0;
> ch0->iir[1].A2=0;
>
> ch0->iir[2].B0=1;
> ch0->iir[2].B1=0;
> ch0->iir[2].B2=0;
> ch0->iir[2].A1=0;
> ch0->iir[2].A2=0;
>
>
> --- In DynoMotion@yahoogroups.com, "pedro558587" <el_gato_pedro@> wrote:
> >
> >
> >
> >
> > reading your post is difficult to understand well, it could be better have tha complete C program. Anyway it seems you did non include the portions of commands in a routine....try to use following
> >
> >
> > #include "KMotionDef.h"
> >
> > int main()
> > {
> > ch0->InputMode=NO_INPUT_MODE;
> > ch0->OutputMode=STEP_DIR_MODE;
> > ch0->Vel=100;
> > ch0->Accel=1000;
> > ch0->Jerk=10000;
> > ch0->P=1;
> > ch0->I=0;
> > ch0->D=0;
> > }
> >
> > I am not sure about values but only of the syntax of commands
> >
> >
> >
> >
> > --- In DynoMotion@yahoogroups.com, "lrapso" <lrapso@> wrote:
> > >
> > > Hello I an new in the group.
> > >
> > > I am setting up a set of 3 stepper motors to work with Kflop and Mch3,.
> > >
> > > So I have repeated the following error:
> > >
> > > ch0->InputMode=NO_INPUT_MODE;
> > > ch0->OutputMode=STEP_DIR_MODE;
> > > ch0->Vel=100;
> > > ch0->Accel=1000;
> > > ch0->Jerk=10000;
> > > ch0->P=1;
> > > ch0->I=0;
> > > ch0->D=0;
> > >
> > >
> > > C:\KMotion421\C Programs\FanON.c:7: incompatible types for redefinition of 'ch0'
> > >
> > > I can't find wht is wrong, this lkines are similar with the example in the Kflop manual...
> > >
> > > Somebody can help me
> > >
> >
>